﻿using MyTask.Domain;
using MyTask.Tasking.Domain.Events;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace MyTask.Tasking.Domain.TaskAggregate
{
    public class TaskInfo : Entity<long>, IAggregateRoot
    {
        public long UserInfoId { get; set; }
        public string TaskName { get; set; }

        public DateTime StartTime { get; set; }

        public DateTime EndTime { get; set; }
        public bool IsComplete { get; set; }

        public string TaskDescrible { get; set; }

        public string TaskResult { get; set; }
        protected TaskInfo() { }
        public TaskInfo(string taskName, DateTime startTime, DateTime endTime, bool isComplete,string taskDescrible,string taskResult, long userInfoId)
        {
            TaskName = taskName;
            StartTime = startTime;
            EndTime = endTime;
            IsComplete = isComplete;
            TaskDescrible = taskDescrible;
            TaskResult = taskResult;
            UserInfoId = userInfoId;
            this.AddDomainEvent(new TaskCreatedDomainEvent(this));
        }
       
    }
}
